require 'rubygems'
require 'treetop'
require 'rcor_command_node'
require 'no_method_args_node'
require 'with_method_args_node'
require 'named_variable_node'
require 'method_call_node'
require 'statement_node'
require 'rcor_tag_node'

Treetop.load 'rcor_cmd'
Treetop.load 'rcor_tag'
Treetop.load "rcor"

class RCorParser

  def initialize
    @parser = RCorGrammarParser.new
    @tag_parser = RCorTagGrammarParser.new
    @cmd_parser = RCorCommandGrammarParser.new
  end

  def parse_cond_cmd(s)
    @cmd_parser.parse(s)
  end
  
  def parse_tag(s)
    @tag_parser.parse(s)
  end
  
  def parse(s)
    @parser.parse(s)
  end

end
